<%@page import="com.wanmait.cookbook.vo.IngredientsType"%>
<%@page import="com.wanmait.cookbook.vo.IngredientsTypeSecond"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%
	List<IngredientsType> ingredientsTypes = (List<IngredientsType>) request.getAttribute("ingredientsTypes");

	for (int i = 0; i < ingredientsTypes.size(); i++) 
	{
%>
<div class="diet clearfix">
	<span><%=ingredientsTypes.get(i).getTitle()%></span>
	<div class="imublo clearfix">
		<%
			List<IngredientsTypeSecond> ingredientsTypeSeconds = (List<IngredientsTypeSecond>) request
						.getAttribute("ingredientsTypeSeconds");
				int count=0;
				for (int j = 0; j < ingredientsTypeSeconds.size(); j++) 
				{
					if (ingredientsTypeSeconds.get(j).getIngredientsType().getId() == ingredientsTypes.get(i).getId()) 
					{
						count++;
					if(count>6){continue;}
		%>
		<a href="<%=request.getContextPath() %>/indexServlet?action=detailFood&name=<%=ingredientsTypeSeconds.get(j).getTitle()%>" target="_blank"><%=ingredientsTypeSeconds.get(j).getTitle()%></a>
		<%
			  		}

				}
		%>
	</div>
</div>
<%
	}
%>


